<?php
$title='用户中心';
include './head.php';
if($_GET['do']=="edit" && $_POST['type']=="edit"){
	$newp = daddslashes($_POST['newp']);
	$sql = "update tell_users set pass='$newp' where id='{$userrow['id']}'";
	if($DB->query($sql)){
			setcookie("user_token",'',0,0);
			exit("<script>alert('修改成功!请使用新密码登录');window.location.href='/login.php';</script>");
			
			}else{
				exit("<script>alert('修改失败');history.go(-1);</script>");
				}
}
?>
<script>
$(document).ready(function () {
	$('#start').click(function(){
		$("#start").html('loading');
		$('#result').hide();
		$('#result').html('<div class="alert alert-info"><img src="../assets/img/load.gif">&nbsp;请稍等，正在发起通话中。。。</div>');
		$("#result").slideDown();
		$.get("submit.php",
		{
			phone:$('#phone').val(),
			display:$('#display').val(),
			target:$('#target').val(),
			km:$('#km').val(),
		},
		function(data,status){
			$("#start").html('提交');
			$('#result').hide();
			$('#result').html(data);
			$("#result").slideDown();
		});
	});
});
</script>
  <div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
      <div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">网站公告</h3></div>
          <?=$conf['gg']?>
      </div>
<div class="panel panel-info">
	<div class="panel-heading">
		<h3 class="panel-title">我的信息</h3>
	</div>
	<ul class="list-group">
		<li class="list-group-item">
			<b>用户组：</b>
			<?=$userrow['vip']?"<font color='red'>VIP</font>&nbsp;VIP到期时间:".$userrow['vipenddate']:"不是VIP"?>&nbsp;<a href="shop.php?type=buyvip" class="label label-primary form-control">开通[续费]</a>
		</li>
		<li class="list-group-item">
			<b>代理级别：</b>
            <?php 
			if($userrow['agent']){
				$dlname = $DB->get_row("select * from tell_level where id='{$userrow['agent']}' limit 1");
		} 
			?><?=$userrow['agent']?"<font color='red'>".$dlname['name']."</font>":"不是代理"?>&nbsp;<a href="shop.php?type=uplevel" class="label label-primary form-control">升级</a>
		</li>
		<li class="list-group-item">
			<b>账号余额：</b>
            <?=$userrow['money']?>&nbsp;&nbsp;&nbsp;<a href="./alipay.php" class="label label-primary form-control">支付宝--立即充值</a>
		</li>
		
		<li class="list-group-item">
			<b>绑定QQ：</b>
            <?=$userrow['qq']?>
		</li>
        <li class="list-group-item">
			<b>手机号：</b>
			<?=$userrow['phone']?>
		</li>
		<li class="list-group-item">
			<b>修改密码：</b>
		</li>
        <li class="list-group-item">
        <form action="?do=edit" method="post" class="form-horizontal" >
        	<input type="hidden" name="type" value="edit" />
			<input type="text" name="newp" class="form-control" required/>
        </li>
        <li class="list-group-item">
            <input type="submit" name="submit" value="修改" class="btn btn-primary form-control"/>
         </form>
        </li>
	</ul>
    
              
</div>
<p><input id="phone" type="text" class="form-control" placeholder="你的手机号码"></p>
              <p><input id="display" type="text" class="form-control" placeholder="在对方手机上显示的号码"></p>
			  <p><input id="target" type="text" class="form-control" placeholder="拨打的号码"></p>
			  <p><button type="button" class="btn btn-primary btn-block" id="start" data-complete-text="Loading finished">提交</button></p>
			  <p id="result"></p>
<div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">ZYE.CC公告</h3></div>
          <?=$conf['dgg']?>
      </div>
    </div>
  </div>
  